<?php

/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

class CommentsWidget extends CWidget {

    public $post_id;
    public $category_id;
    public $model;

    public function init() {
        parent::init();

        $this->model = Comments::getComments($this->category_id, $this->post_id);
    }

    public function run() {
        $this->render('CommentsWidget/index', array(
            'model' => $this->model,
            'category_id' => $this->category_id,
            'post_id' => $this->post_id
        ));
    }

}
